package com.tanger.es;

import lombok.Builder;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

/**
 * @Description TODO
 * @Author Hchenbin
 * @Date 2023-12-08 16:20
 * @Version 1.0
 */
@Data
@Builder
public class GoodsActivity {

    @Field
    private Long id;
    @Field(type = FieldType.Nested)
    private List<Item> content;

    @Data
    public static class Item {
        //analyzer = "analyzer_ngram", searchAnalyzer = "analyzer_ngram_search" 分词器设置
        @Field(type = FieldType.Text, analyzer = "analyzer_ngram", searchAnalyzer = "analyzer_ngram_search")
        private String type;
        @Field(type = FieldType.Text, analyzer = "analyzer_standard", searchAnalyzer = "analyzer_standard")
        private String typeEn;
        @Field(type = FieldType.Text, analyzer = "analyzer_ngram", searchAnalyzer = "analyzer_ngram_search")
        private String name;
        @Field(type = FieldType.Text, analyzer = "analyzer_standard", searchAnalyzer = "analyzer_standard")
        private String nameEn;
    }
}
